package com.example.demobk.service;

import com.example.demobk.entity.Articleinfo;
import com.example.demobk.mapper.ArticleMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleService {
    @Autowired
    private ArticleMapper articleMapper;

    public int getArtCountByUid(Integer uid) {
        return articleMapper.getArtCountByUid(uid);
    }
    public List<Articleinfo> getMyList(Integer uid) {
        return articleMapper.getMyList(uid);
    }
    public  int del(Integer id,Integer uid){

        return  articleMapper.del(id,uid);
    }

    public  Articleinfo getDetail(Integer id){
        return articleMapper.getDetail(id);
    }
    public int incrRcount(Integer id){
        return  articleMapper.incrRcount(id);
    }



    public int add(Articleinfo articleinfo){
        return  articleMapper.add(articleinfo);

    }
    public  int update(Articleinfo articleinfo){
        return articleMapper.update(articleinfo);
    }
    public List<Articleinfo> getListPage(Integer psize, Integer offsize){

        return articleMapper.getListPage(psize,offsize);
    }
}


